package zdream.rockchronicle.desktop;

import com.badlogic.gdx.Game;
import com.badlogic.gdx.backends.lwjgl.LwjglApplication;
import com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration;

import zdream.rockchronicle.RockChronicle;
import zdream.rockchronicle.screen.MainMenuScreen;

/**
 * 用 idea 启动, 需要: 启动位置在 desktop 目录
 */
public class DesktopLauncher {
	public static void main (String[] arg) {
		LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();

		RockChronicleDesktop game = new RockChronicleDesktop();
		config.width = game.app.width;
		config.height = game.app.height;
		config.title = "Mega Man Control";
		new LwjglApplication(game, config);
	}

	public static class RockChronicleDesktop extends Game {
		public final RockChronicle app;

		{
			RockChronicle.initFromGame(this);
			app = RockChronicle.INSTANCE;
		}

		@Override
		public void create() {
			app.create();
			this.setScreen(new MainMenuScreen(app));
		}
	}
}
